import request from '@/utils/request'

// 查询车间信息列表
export function listWorkshop(query) {
    return request({
        url: '/mes/workshop/list',
        method: 'get',
        params: query
    })
}

// 查询车间信息详细
export function getWorkshop(workshopId) {
    return request({
        url: '/mes/workshop/' + workshopId,
        method: 'get'
    })
}

// 新增车间信息
export function addWorkshop(data) {
    return request({
        url: '/mes/workshop',
        method: 'post',
        data: data
    })
}

// 修改车间信息
export function updateWorkshop(data) {
    return request({
        url: '/mes/workshop',
        method: 'put',
        data: data
    })
}

// 删除车间信息
export function delWorkshop(workshopId) {
    return request({
        url: '/mes/workshop/' + workshopId,
        method: 'delete'
    })
}

// 校验车间编码唯一性
export function checkWorkshopCodeUnique(data) {
    return request({
        url: '/mes/workshop/checkWorkshopCodeUnique',
        method: 'post',
        data: data
    })
}

// 查询启用状态的车间列表
export function selectActiveWorkshopList() {
    return request({
        url: '/mes/workshop/selectActiveWorkshopList',
        method: 'get'
    })
}